//
//  MineViewCell.m
//  Peso Guide
//
//  Created by macbook on 2025/6/12.
//

#import "MineViewCell.h"
#import "CustomWebViewController.h"
#import "ProductDetailViewController.h"

@interface MineViewCell ()

@property (nonatomic, strong) UILabel *titLabel;
@property (nonatomic, strong) UIImageView *rightImg;
@property (nonatomic, strong) UIImageView *backImg;

@end

@implementation MineViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titLabel = [PesoKit createLabelWithFrame:CGRectMake(32, 0, KScreenWidth-32*2, 60) backGroundColor:ColorHex(@"#FFFFFF") text:@"" textColor:ColorHex(@"#0E1D31") font:FONT(FontWeightStyleMedium, 15)];
        [self.contentView addSubview:_titLabel];
        
        _rightImg = [PesoKit createImageViewWithFrame:CGRectMake(KScreenWidth-33-7, 26.5, 7, 12) imageNamed:@"ic_product_right_icon"];
        [self.contentView addSubview:_rightImg];
        
        _backImg = [PesoKit createImageViewWithFrame:CGRectMake(20, 0, KScreenWidth-40, (KScreenWidth-40)*0.346) imageNamed:@"ic_mine_top_cell"];
        _backImg.hidden = YES;
        [self.contentView addSubview:_backImg];
    }
    return self;
}

- (void)setDataDic:(NSDictionary *)dataDic {
    _dataDic = dataDic;
    
    if (_index == 0) {
        _backImg.hidden = NO;
        _titLabel.hidden = YES;
        _rightImg.hidden = YES;
    }else {
        _backImg.hidden = YES;
        _titLabel.hidden = NO;
        _rightImg.hidden = NO;
        NSString *accidental = [NSString stringWithFormat:@"%@",[dataDic safeObjectForKey:@"accidental"]];
        _titLabel.text = accidental;
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
